package com.wkk.mapper;

import com.wkk.entity.Course;
import com.wkk.entity.MyCourse;
import com.wkk.entity.MyCourseSign;
import com.wkk.entity.MyHistory;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

@Mapper
public interface CourseMapper {

    //==============对课程的操作以及课程的查看=========


    Course selectOne(Integer cid);

    List<Course> selectList();

    List<Course> selectListByNotPublic();

    List<Course> selectListByMold(String mold);

    List<Course> selectListByTeacher(String teacher);

    List<Course> selectListOrderBy(String courseInfo);

    int insertCourse(Course course);

    int updateCourse(Course course);

    int deleteCourse(Integer cid);

    int updateSearchCountOrOrderCount(Map<String,Object> map);

    int updateCourseAchieveMan(Integer cid);

    List<Course> selectListByCondition(Map<String,Object> map);

    List<Course> countByCondition(String condition);

    List<Course> selectListByQuery(Map<String,Object> map);

    List<Course> countByQuery(Course course);

        //===============对我的课程进行的持久化接口=============
    List<MyCourse> queryMyCourses(Integer uid);

    List<MyCourse> queryMyCoursesByCid(Integer cid);

    int deleteMyCourse(Integer id);

    int updateMyCourse(MyCourse myCourse);

    int insertMyCourse(MyCourse myCourse);

    int insertMyCourseByCoach(MyCourse myCourse);

    int updateMyCourseState(Integer id);

    MyCourse selectOneById(Integer id);

    int updateMyCourseLastNum(Integer id);

     //==============对我的查询历史进行的持久化接口=============

    int insertHistory(MyHistory myHistory);

    int addSearchCountInMyHistory(MyHistory myHistory);

    List<MyHistory> selectListByUid(Integer uid);

    MyHistory selectOneByUidAndMold(MyHistory myHistory);

    //============== 对课程打卡进行操作  =====
    MyCourseSign selectOneByMyId(Integer id);

    int insertSignIn(Integer id);

    int updateDateById(Integer id);

}
